package com.yzk.train.business.controller;

import com.yzk.train.business.request.DailyTrainStationQueryAllReq;
import com.yzk.train.business.response.DailyTrainStationQueryResp;
import com.yzk.train.business.service.DailyTrainStationService;
import com.yzk.train.common.response.Result;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/daily-train-station")
public class DailyTrainStationController {

    @Autowired
    private DailyTrainStationService dailyTrainStationService;

    @GetMapping("/pass")
    public Result<List<DailyTrainStationQueryResp>> queryByTrain(@Valid DailyTrainStationQueryAllReq req) {
        List<DailyTrainStationQueryResp> list = dailyTrainStationService.queryByDateAndTrainCode(req.getDate(), req.getTrainCode());
        return Result.ok(list);
    }

}
